package com.donfu.web.controller.wxhouse;

import com.donfu.common.annotation.Log;
import com.donfu.common.core.controller.BaseController;
import com.donfu.common.core.domain.AjaxResult;
import com.donfu.common.core.page.TableDataInfo;
import com.donfu.common.enums.BusinessType;
import com.donfu.common.utils.poi.ExcelUtil;
import com.donfu.system.domain.house.HouseNovelty;
import com.donfu.system.domain.house.HouseNoveltyType;
import com.donfu.system.service.house.IHouseNoveltyService;
import com.donfu.system.service.house.IHouseNoveltyTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * 品牌文章Controller
 * 
 * @author mo
 * @date 2021-12-01
 */
@Api(tags = "前台-品牌文章")
@RestController
@RequestMapping("/wx/house/novelty")
public class WebHouseNoveltyController extends BaseController
{
    @Autowired
    private IHouseNoveltyService houseNoveltyService;
    @Autowired
    private IHouseNoveltyTypeService houseNoveltyTypeService;

    /**
     * 查询品牌类型列表
     */
//    @PreAuthorize("@ss.hasPermi('system:type:list')")
    @GetMapping("/type")
    public TableDataInfo list(HouseNoveltyType houseNoveltyType)
    {
        startPage();
        List<HouseNoveltyType> list = houseNoveltyTypeService.selectHouseNoveltyTypeList(houseNoveltyType);
        return getDataTable(list);
    }

    /**
     * 查询品牌文章列表
     */
//    @PreAuthorize("@ss.hasPermi('house:novelty:list')")
    @ApiOperation("列表查询")
    @GetMapping("/list")
    public TableDataInfo list(HouseNovelty houseNovelty)
    {
        startPage();
        List<HouseNovelty> list = houseNoveltyService.selectHouseNoveltyList(houseNovelty);
        return getDataTable(list);
    }

    /**
     * 获取品牌文章详细信息
     */
//    @PreAuthorize("@ss.hasPermi('house:novelty:query')")
    @ApiOperation("详情")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(houseNoveltyService.selectHouseNoveltyById(id));
    }

}
